
tiff('Figure2.tiff', width = 8.7, height = 6.5, units = 'cm', pointsize = 6, res = 300)

.tab <- table2
.xlims <- c(-.19, 0.30)
.ylims <- c(-1, 8)
.ticks <- seq(-0.10, 0.30, by = 0.10)
.x.vec <- .xlims[1]
.y.vec <- c(7, 6, 4, 3, 1, 0)
.cispread <- .014
.cilwd <- 2
.estlwd <- 2
.estcex <- 1.7
.col.vec <- c('red', 'lightcoral', 'dodgerblue', 'deepskyblue', 'orange', 'gold3')
.text.vec <- c('Path to Citizenship', 'Legal Immigration\n   ',
  'Trust MOC', 'Approve of MOC', 'Likely to Vote for MOC',
  'Actually Voted for MOC')

par(mar = c(1, 3.5, 0, 0))
plot(0, type = 'n', bty = 'n', xlim = .xlims, ylim = .ylims,
  xaxt = 'n', yaxt='n', xlab='', ylab='')

# axes
segments(.ticks[-2], .ylims[1], .ticks[-2], .ylims[2], col = 'lightgray', lwd = .5)
segments(0, .ylims[1], 0, .ylims[2], col = 'black', lwd = .5, lty = 3)
segments(.ticks[1], .ylims[1], tail(.ticks, 1), .ylims[1])
segments(.ticks[1], .ylims[2], tail(.ticks, 1), .ylims[2])

# ticks
segments(.ticks, .ylims[2] - .03, .ticks, .ylims[2] + .03)
segments(.ticks, .ylims[1] - .03, .ticks, .ylims[1] + .03)

# Confidence intervals
segments(.tab$q025, .y.vec, .tab$CACE - .cispread, .y.vec, 
           col = .col.vec, lwd = .cilwd)
segments(.tab$CACE + .cispread, .y.vec, .tab$q975, .y.vec, 
           col = .col.vec, lwd = .cilwd)

# point estimates
points(.tab$CACE, .y.vec, pch = 21, bg = .col.vec, cex = .estcex, lwd = .estlwd, col = .col.vec)

# labels
text(.x.vec, .y.vec, .text.vec, xpd = TRUE, cex = 1)
#text(rep(.35, 6), .y.vec, paste('N =', .tab$N), xpd = TRUE, cex = 1, font = 3)
text(.x.vec, .y.vec[1] + .7, 'Substantive', xpd = TRUE, cex = 1, font = 2)
text(.x.vec, .y.vec[3] + .7, 'Attributional', xpd = TRUE, cex = 1, font = 2)
text(.x.vec, .y.vec[5] + .7, 'Behavioral', xpd = TRUE, cex = 1, font = 2)
text(.x.vec, .y.vec[2] - .25, '(not discussed)', font = 3, xpd = TRUE, cex = 1)
text(c(0, 0.2), .ylims[1] - .35, c('0%', '20%'),
  cex = 1, xpd = TRUE)
#text(.1, .ylims[1] - 1.5, 'Complier Average Causal Effect Estimates\nwith 95% Confidence Intervals', xpd = TRUE)
text(.1, .ylims[1] - 1.5, 'Complier Average Causal Effect Estimates', xpd = TRUE)
#mtext('Figure 2. Persuasion Effects for Members of Congress', 3, 1, font = 2)
dev.off()
